import request from '@/utils/request'

// 查询排行榜列表
export function listLeaderboard(query) {
  return request({
    url: '/system/leaderboard/getLeaderboard',
    method: 'post',
    params: query
  })
}

// 查询排行榜详细
export function getLeaderboard(data) {
  return request({
    url: '/system/leaderboard/listByType?page=' + data.page + '&size=' + data.size + '&type=' + data.type + '&start=' + data.start + '&end=' + data.end,
    method: 'post',

  })
}

// 新增排行榜
export function addLeaderboard(data) {
  return request({
    url: '/system/leaderboard',
    method: 'post',
    data: data
  })
}

// 修改排行榜
export function updateLeaderboard(data) {
  return request({
    url: '/system/leaderboard/edit',
    method: 'post',
    data: data
  })
}

// 删除排行榜
export function delLeaderboard(id) {
  return request({
    url: '/system/leaderboard/' + id,
    method: 'delete'
  })
}

//结算排行榜
export function settleLeaderboard(data) {
  return request({
    url: '/system/leaderboard/disablePhb?startTime=' + data.startTime + '&endTime=' + data.endTime + '&type=' + data.type + '&isDisable=' + data.isDisable,
    method: 'post',
  })
}